home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.20000114-20000217
/
000141_news@columbia.edu _Tue Jan 25 15:27:48 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
3KB
Return-Path: <news@columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id PAA07930
for <kermit.misc@watsun.cc.columbia.edu>; Tue, 25 Jan 2000 15:27:47 -0500 (EST)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id PAA22711
for kermit.misc@watsun.cc.columbia.edu; Tue, 25 Jan 2000 15:15:13 -0500 (EST)
X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
From: Peter Burkholder <pburkholder@seanet.com>
Subject: Re: Changing Unix C-kermit> prompt
Date: Tue, 25 Jan 2000 12:06:54 -0800
Organization: University of Washington
Message-ID: <388E025E.60D8E098@seanet.com>
To: kermit.misc@columbia.edu
Thanks Frank,
Now I see where "set prompt" is in the index. I'm still
finding my way around this program, but liking it better
all the time. Thanks for the tip.
Cheers,
Peter
CheersFrank da Cruz wrote:
>
> In article <388DD7E6.ED7EA6A6@seanet.com>,
> Peter Burkholder <peter@geophys.washington.edu> wrote:
> : I'm doing some script writing rather deep in my directory
> : tree, so I'm always looking at a prompt like:
> :
> : (/export/home/badger/spyder/kermit/ck7/) C-Kermit>
> :
> : which hardly leaves space for my commands w/o wrapping. I don't
> : see in the book or documentation how I truncate the current
> : directory listing, but I hope there is. I'd be happy with;
> : (ck7) C-Kermit>
> :
> The prompt definition can contain macros, variables, function calls,
> or anything else. The definition is re-evaluated each time the prompt
> changes. The default definition is:
>
> (\v(directory)) C-Kermit>
>
> which shows the current directory in parentheses; if you give a CD
> command, the prompt changes.
>
> C-Kermit 7.0 includes a lot of new string functions. Unfortunately, none
> of them does exactly what you need (one of them, \fstripx(), does exactly
> the opposite: removes the rightmost segment from the string).
>
> But where there's a will, there's a way:
>
> set prompt (\freplace(\fsubstr(\v(dir),\frindex(/,\v(dir),2)),/,)) C-Kermit>
>
> In which:
>
> \frindex(/,\v(dir),2)
> Gives the position of the rightmost slash not counting the trailing one.
>
> \fsubstr(\v(dir),\frindex(/,\v(dir),2))
> Gives the rightmost directory segment, with slashes
>
> \freplace(\fsubstr(\v(dir),\frindex(/,\v(dir),2)),/,)
> Removes the the slashes.
>
> The result, in your case, should be:
>
> (ck7) C-Kermit>
>
> You can achieve any other desired effect with C-Kermit's string functions.
> Most of them are documented in "Using C-Kermit". New ones are documented
> in the ckermit2.txt file. The SHOW FUNCTIONS command lists the functions
> that are available. In C-Kermit 7.0, you can get help on a particular
> function with:
>
> help function xxx
>
> where xxx is the function name. This tells you the calling sequence,
> action, and return value.
>
> - Frank
(*)/ (*)